<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>dom操作</title>
    <script src='./jquery.js'></script>
</head>
<body>
    <div class="app"></div>
    <div class="btn">点击变色</div>
</body>
<script>
    // var div = document.getElementsByTagName('div')

    // var newP = document.createElement('p');

    // newP.innerText = '我是一个追加的元素'

    // div[0].appendChild(newP);

    $('.app').append('<h1>我是jquery添加的元素h1</h1>')

    $('.app').css({'color':'red','font-size':'40px'})

    $('.btn').click(function() {
        // console.log(this)
        // this.css({'color':'red'});
        // $('.app').css({'color':'green'});

        //this => element(元素)，不能调用$里面的方法

        //$(this) => jQuery对象

        console.log('元素',this)
        console.log('jq对象',$(this))
    })
</script>
</html>